<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns:c="http://java.sun.com/jstl/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
	  xmlns:jsp="http://java.sun.com/JSP/Page"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:s="http://jboss.com/products/seam/taglib"
	  xmlns:spring="http://www.springframework.org/tags"
	  xmlns:a4j="http://richfaces.org/a4j"
	  xmlns:rich="http://richfaces.org/rich"
	  xmlns:t="http://myfaces.apache.org/tomahawk"
	  xmlns:clickframes="http://${appspec.domain}"
	  xmlns="http://www.w3.org/1999/xhtml">
<f:loadBundle basename="messages" var="messages" />
<fmt:setBundle basename='messages' scope='application' />

<ui:composition
    template="/WEB-INF/facelets/layout/layout.xhtml">

    <ui:define name="title">#{pageController.page.title ne null ? pageController.page.title : 'Welcome'}</ui:define>
    <ui:param name="clickframesPage" value="page" />

    <ui:define name="page-content">

	<c:choose>
		<c:when test="${pageController.page ne null}">
	    <div id="content" class="grid_4">
	    	<h1>#{pageController.page.title}</h1>
	    	<div id="edit-page-link"><a href="edit.seam?id=${pageController.page.id}">Edit this page &#187;</a></div>
			<h:outputText escape="false" value="#{pageController.page.htmlContent}" />
	    </div>
	    </c:when>
		<c:otherwise>
			<div id="content" class="grid_4">
				<h1>Welcome!</h1>
				<p>The quick brown fox jumps over the lazy dog.</p>
			</div>
		</c:otherwise>
	</c:choose>
    
    <div id="pages" class="grid_2">
    
    	<div id="pages-container">
	
			<div class="button"><a href="edit.seam">Create new page</a></div>
			
			<ul>
			<c:forEach items="#{pageController.userPages}" var="page">
			    <li class="#{page.id == pageController.page.id ? 'selected' : ''}"><a href="page.seam?id=#{page.id}">#{page.title}</a></li>
			</c:forEach>
			</ul>
		
		</div>
		
    </div>
    <div class="clear"></div>

    </ui:define>
</ui:composition>
</html><!-- clickframes::version=2719553113::clickframes -->